# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.CloudDeploy.V1.Model.AutomationRunEvent do
  @moduledoc """
  Payload proto for "clouddeploy.googleapis.com/automation_run" Platform Log event that describes the AutomationRun related events.

  ## Attributes

  *   `automationId` (*type:* `String.t`, *default:* `nil`) - Identifier of the `Automation`.
  *   `automationRun` (*type:* `String.t`, *default:* `nil`) - The name of the `AutomationRun`.
  *   `destinationTargetId` (*type:* `String.t`, *default:* `nil`) - ID of the `Target` to which the `AutomationRun` is created.
  *   `message` (*type:* `String.t`, *default:* `nil`) - Debug message for when there is an update on the AutomationRun. Provides further details about the resource creation or state change.
  *   `pipelineUid` (*type:* `String.t`, *default:* `nil`) - Unique identifier of the `DeliveryPipeline`.
  *   `ruleId` (*type:* `String.t`, *default:* `nil`) - Identifier of the `Automation` rule.
  *   `type` (*type:* `String.t`, *default:* `nil`) - Type of this notification, e.g. for a Pub/Sub failure.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :automationId => String.t() | nil,
          :automationRun => String.t() | nil,
          :destinationTargetId => String.t() | nil,
          :message => String.t() | nil,
          :pipelineUid => String.t() | nil,
          :ruleId => String.t() | nil,
          :type => String.t() | nil
        }

  field(:automationId)
  field(:automationRun)
  field(:destinationTargetId)
  field(:message)
  field(:pipelineUid)
  field(:ruleId)
  field(:type)
end

defimpl Poison.Decoder, for: GoogleApi.CloudDeploy.V1.Model.AutomationRunEvent do
  def decode(value, options) do
    GoogleApi.CloudDeploy.V1.Model.AutomationRunEvent.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.CloudDeploy.V1.Model.AutomationRunEvent do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
